<?php
	if(!isset($_REQUEST['ajax'])){ $_REQUEST['ajax'] = "";}
	if($_REQUEST['ajax']!=true) include 'header.tpl.php';
	include 'usercp_panel.tpl.php';
?>
	<div class="row">
		<div class="col-lg-12">
			<div class="panel">
				<div class="panel-heading">
					<div class="panel-title"><i class="icon-comments"></i> <?php echo $this->language['mail_create'];?></div>
				</div>
				<div class="panel-body">
					<form action="javascript:writeMsg();" class="form-horizontal">
						<div class="form-group">
							<label class="control-label col-lg-2">Chọn người nhận :</label>
							<div class="col-lg-5">
								<select class="form-control" id="Receiver">
									<option value="">----- Chọn người nhận -----</option>
									<?php echo $this->selectReceiver;?>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-lg-2">Tiêu đề :</label>
							<div class="col-lg-10">
								<input type="text" name="mTitle" id="mTitle" class="form-control" value="<?php if(isset($this->title)) echo $this->title;?>" >
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-lg-2">Đính kèm File :</label>
							<div class="col-lg-10">
								<div id="file-uploader"></div>
								<input type=hidden id="uploadfile" name="uploadfile" value="">
								<div id="uploaded"></div>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-lg-2">Nội dung :</label>
							<div class="col-lg-10">
								<textarea class="form-control wysiwyg" rows="15" name="mContent" id="mContent"><?php if(isset($this->oldMsg)) echo $this->oldMsg;?></textarea>
							</div>
						</div>
						<div class="form-group">
							<div class="col-lg-offset-2 col-lg-10">
								<button class="btn btn-primary" type="submit"><?php echo $this->language['accept'];?></button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<link href="resources/css/fileuploader.css" type="text/css" rel="stylesheet" />
	<script type="text/javascript" src="resources/scripts/fileuploader.js"></script>
	<script type="text/javascript" src="resources/scripts/jquery.wysiwyg.js"></script>
	<script>
	$(".wysiwyg").wysiwyg();
	var uploader = new qq.FileUploader({
		element: document.getElementById('file-uploader'),
		action: 'file.php?act=upload',
		debug: false
	});
	</script>
<?php if(isset($this->breadcrumb) && isset($this->title_header)):?>
	<script type="text/javascript">
		$(function() {
			$("#title-header").text('<?php echo $this->title_header;?>');
			$("#breadcrumb").html('<?php echo build_breadcrumb($this->breadcrumb);?>');
		});
	</script>
<?php endif;?>
<?php
	if($_REQUEST['ajax']!=true) include 'footer.tpl.php';
?>